package bb.lanxing.lib.devices.sprint.entity;

import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.SerializedName;

public class PersonalSettings implements Parcelable {
    public static final int BACKLIGHT_ALWAYS = 1;
    public static final int BACKLIGHT_AUTO = 0;
    public static final int BACKLIGHT_DISABLE = 2;
    public static final Parcelable.Creator<PersonalSettings> CREATOR = new Parcelable.Creator<PersonalSettings>() {
        @Override
        public PersonalSettings createFromParcel(Parcel parcel) {
            return new PersonalSettings(parcel);
        }

        @Override
        public PersonalSettings[] newArray(int i) {
            return new PersonalSettings[i];
        }
    };
    public static final int GENDER_FEMALE = 1;
    public static final int GENDER_MALE = 0;
    public static final int LANGUAGE_CHINEASE = 0;
    public static final int LANGUAGE_ENGLISH = 1;
    public static final int UNIT_BRITISH = 1;
    public static final int UNIT_METRIC = 0;

    private int age;
    @SerializedName(SettingSupports.SUPPORT_ITEM_ALAHR)
    private int alaHr;
    @SerializedName(SettingSupports.SUPPORT_ITEM_ALASPD)
    private SprintDecimal alaSpeed;
    @SerializedName(SettingSupports.SUPPORT_ITEM_AUTO_LAP)
    private boolean autoLap;
    @SerializedName(SettingSupports.SUPPORT_ITEM_AUTO_PAUSE)
    private boolean autoPause;
    private int backlight;
    @SerializedName(SettingSupports.SUPPORT_ITEM_BIKE_NUM)
    private int bickNum;
    @SerializedName("file_conver")
    private boolean fileCover;
    @SerializedName(SettingSupports.SUPPORT_ITEM_FTP)
    private int ftp;
    private int gender;
    @SerializedName("IsInitBit")
    private boolean isInitBit;
    @SerializedName(SettingSupports.SUPPORT_ITEM_KEY_TONE)
    private boolean keyTone;
    //private int language;
    private int language;
    @SerializedName(SettingSupports.SUPPORT_ITEM_LTHR)
    private int lthr;
    @SerializedName(SettingSupports.SUPPORT_ITEM_MHR)
    private int mhr;
    private int sport;
    private SprintDecimal stature;
    @SerializedName(SettingSupports.SUPPORT_ITEM_TIME_ZONE)
    private float timeZone;
    private int unit;
    private SprintDecimal weight;
 /*   //add by wangsm
    private String device_model;
    private int update_at;
    private String sn;
    private String version;

    private String language_str;


    private Integer temperatureUnit;
    private Integer timeFormatter;
    private Integer autoPauseInt;
    private Integer overWrite;
    //private Integer screenOnMode;//see backlight*/


    //end by wangsm
    public @interface BACKLIGHT {
    }

    public @interface GENDER {
    }

    public @interface LANGUAGE {
    }

    public @interface UNIT {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public PersonalSettings() {
    }

    public PersonalSettings(PersonalSettings personalSettings) {
        this.weight = new SprintWeightVal(personalSettings.weight);
        this.age = personalSettings.age;
        this.stature = new SprintHeightVal(personalSettings.stature);
        this.gender = personalSettings.gender;
        this.language = personalSettings.language;
        this.unit = personalSettings.unit;
        this.backlight = personalSettings.backlight;
        this.timeZone = personalSettings.timeZone;
        this.autoLap = personalSettings.autoLap;
        this.autoPause = personalSettings.autoPause;
        this.fileCover = personalSettings.fileCover;
        this.bickNum = personalSettings.bickNum;
        this.alaHr = personalSettings.alaHr;
        this.mhr = personalSettings.mhr;
        this.lthr = personalSettings.lthr;
        this.ftp = personalSettings.ftp;
        this.alaSpeed = new SprintMaxSpdVal(personalSettings.alaSpeed);
        this.isInitBit = personalSettings.isInitBit;
        this.keyTone = personalSettings.keyTone;
        this.sport = personalSettings.sport;
/*        //add by wangsm
        this.device_model = personalSettings.device_model;
        this.update_at = personalSettings.update_at;
        this.sn = personalSettings.sn;
        this.version = personalSettings.version;
        this.language_str = personalSettings.language_str;
        this.temperatureUnit = personalSettings.temperatureUnit;
        this.timeFormatter = personalSettings.timeFormatter;
        this.autoPauseInt = personalSettings.autoPauseInt;
        this.overWrite = personalSettings.overWrite;
        //end by wangsm*/
    }

    protected PersonalSettings(Parcel parcel) {
        this.weight = (SprintDecimal) parcel.readParcelable(SprintDecimal.class.getClassLoader());
        this.age = parcel.readInt();
        this.stature = (SprintDecimal) parcel.readParcelable(SprintDecimal.class.getClassLoader());
        this.gender = parcel.readInt();
        this.language = parcel.readInt();
        this.unit = parcel.readInt();
        this.backlight = parcel.readInt();
        this.timeZone = parcel.readFloat();
        boolean z = true;
        this.autoLap = parcel.readByte() != 0;
        this.autoPause = parcel.readByte() != 0;
        this.fileCover = parcel.readByte() != 0;
        this.bickNum = parcel.readInt();
        this.mhr = parcel.readInt();
        this.lthr = parcel.readInt();
        this.ftp = parcel.readInt();
        this.alaSpeed = (SprintDecimal) parcel.readParcelable(SprintDecimal.class.getClassLoader());
        this.alaHr = parcel.readInt();
        this.isInitBit = parcel.readByte() != 0;
        this.keyTone = parcel.readInt() == 0 ? false : z;
        this.sport = parcel.readInt();
        //add by wangsm
       /* this.device_model = parcel.readString();
        this.update_at = parcel.readInt();
        this.sn = parcel.readString();
        this.version = parcel.readString();
        this.language_str = parcel.readString();

        this.temperatureUnit = parcel.readInt();
        this.timeFormatter = parcel.readInt();
        this.autoPauseInt = parcel.readInt();
        this.overWrite = parcel.readInt();*/

        //end by wangsm
    }

    public int getAge() {
        return this.age;
    }

    public void setAge(int i) {
        this.age = i;
    }

    public int getGender() {
        return this.gender;
    }

    public void setGender(int i) {
        this.gender = i;
    }

    public int getLanguage() {
        return this.language;
    }

    public void setLanguage(int i) {
        this.language = i;
    }

    public int getUnit() {
        return this.unit;
    }

    public void setUnit(int i) {
        this.unit = i;
    }

    public int getBacklight() {
        return this.backlight;
    }

    public void setBacklight(int i) {
        this.backlight = i;
    }

    public float getTimeZone() {
        return this.timeZone;
    }

    public void setTimeZone(float f) {
        this.timeZone = f;
    }

    public boolean isAutoLap() {
        return this.autoLap;
    }

    public void setAutoLap(boolean z) {
        this.autoLap = z;
    }

    public boolean isAutoPause() {
        return this.autoPause;
    }

    public void setAutoPause(boolean z) {
        this.autoPause = z;
    }

    public boolean isFileCover() {
        return this.fileCover;
    }

    public void setFileCover(boolean z) {
        this.fileCover = z;
    }

    public int getBickNum() {
        return this.bickNum;
    }

    public void setBickNum(int i) {
        this.bickNum = i;
    }

    public int getMhr() {
        return this.mhr;
    }

    public void setMhr(int i) {
        this.mhr = i;
    }

    public int getLthr() {
        return this.lthr;
    }

    public void setLthr(int i) {
        this.lthr = i;
    }

    public int getFtp() {
        return this.ftp;
    }

    public void setFtp(int i) {
        this.ftp = i;
    }

    public SprintDecimal getWeight() {
        return this.weight;
    }

    public void setWeight(SprintDecimal sprintDecimal) {
        this.weight = sprintDecimal;
    }

    public SprintDecimal getStature() {
        return this.stature;
    }

    public void setStature(SprintDecimal sprintDecimal) {
        this.stature = sprintDecimal;
    }

    public SprintDecimal getAlaSpeed() {
        return this.alaSpeed;
    }

    public void setAlaSpeed(SprintDecimal sprintDecimal) {
        this.alaSpeed = sprintDecimal;
    }

    public int getAlaHr() {
        return this.alaHr;
    }

    public void setAlaHr(int i) {
        this.alaHr = i;
    }

    public boolean isInitBit() {
        return this.isInitBit;
    }

    public void setInitBit(boolean z) {
        this.isInitBit = z;
    }

    public boolean isKeyTone() {
        return this.keyTone;
    }

    public void setKeyTone(boolean z) {
        this.keyTone = z;
    }
/*//add by wangsm
    public String getDevice_model() {
        return device_model;
    }

    public void setDevice_model(String device_model) {
        this.device_model = device_model;
    }

    public int getUpdate_at() {
        return update_at;
    }

    public void setUpdate_at(int update_at) {
        this.update_at = update_at;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getLanguage_str() {
        return language_str;
    }

    public void setLanguage_str(String language_str) {
        this.language_str = language_str;
    }


    public Integer getTemperatureUnit() {
        return temperatureUnit;
    }

    public void setTemperatureUnit(Integer temperatureUnit) {
        this.temperatureUnit = temperatureUnit;
    }

    public Integer getTimeFormatter() {
        return timeFormatter;
    }

    public void setTimeFormatter(Integer timeFormatter) {
        this.timeFormatter = timeFormatter;
    }

    public Integer getAutoPauseInt() {
        return autoPauseInt;
    }

    public void setAutoPauseInt(Integer autoPauseInt) {
        this.autoPauseInt = autoPauseInt;
    }

    public Integer getOverWrite() {
        return overWrite;
    }

    public void setOverWrite(Integer overWrite) {
        this.overWrite = overWrite;
    }*/
//end by wangsm
    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeParcelable(this.weight, i);
        parcel.writeInt(this.age);
        parcel.writeParcelable(this.stature, i);
        parcel.writeInt(this.gender);
        parcel.writeInt(this.language);
        parcel.writeInt(this.unit);
        parcel.writeInt(this.backlight);
        parcel.writeFloat(this.timeZone);
        parcel.writeByte(this.autoLap ? (byte) 1 : (byte) 0);
        parcel.writeByte(this.autoPause ? (byte) 1 : (byte) 0);
        parcel.writeByte(this.fileCover ? (byte) 1 : (byte) 0);
        parcel.writeInt(this.bickNum);
        parcel.writeInt(this.mhr);
        parcel.writeInt(this.lthr);
        parcel.writeInt(this.ftp);
        parcel.writeParcelable(this.alaSpeed, i);
        parcel.writeInt(this.alaHr);
        parcel.writeByte(this.isInitBit ? (byte) 1 : (byte) 0);
        parcel.writeInt(this.keyTone ? 1 : 0);
        parcel.writeInt(this.sport);
        //add by wangsm
/*        parcel.writeString(this.device_model);
        parcel.writeInt(this.update_at);
        parcel.writeString(this.sn);
        parcel.writeString(this.version);
        parcel.writeString(this.language_str);

        parcel.writeInt(this.temperatureUnit);
        parcel.writeInt(this.timeFormatter);
        parcel.writeInt(this.autoPauseInt);
        parcel.writeInt(this.overWrite);*/

        //end by wangsm
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        PersonalSettings personalSettings = (PersonalSettings) obj;
        if (this.age != personalSettings.age || this.gender != personalSettings.gender || this.language != personalSettings.language || this.unit != personalSettings.unit || this.backlight != personalSettings.backlight || Float.compare(personalSettings.timeZone, this.timeZone) != 0 || this.autoLap != personalSettings.autoLap || this.autoPause != personalSettings.autoPause || this.fileCover != personalSettings.fileCover || this.bickNum != personalSettings.bickNum || this.mhr != personalSettings.mhr || this.lthr != personalSettings.lthr || this.ftp != personalSettings.ftp || this.alaHr != personalSettings.alaHr || this.keyTone != personalSettings.keyTone || this.sport != personalSettings.sport || this.isInitBit != personalSettings.isInitBit) {
            return false;
        }
        SprintDecimal sprintDecimal = this.weight;
        if (sprintDecimal == null ? personalSettings.weight != null : !sprintDecimal.equals(personalSettings.weight)) {
            return false;
        }
        SprintDecimal sprintDecimal2 = this.stature;
        if (sprintDecimal2 == null ? personalSettings.stature != null : !sprintDecimal2.equals(personalSettings.stature)) {
            return false;
        }
        SprintDecimal sprintDecimal3 = this.alaSpeed;
        SprintDecimal sprintDecimal4 = personalSettings.alaSpeed;
        return sprintDecimal3 != null ? sprintDecimal3.equals(sprintDecimal4) : sprintDecimal4 == null;
    }

    public int hashCode() {
        SprintDecimal sprintDecimal = this.weight;
        int i = 0;
        int hashCode = (((sprintDecimal != null ? sprintDecimal.hashCode() : 0) * 31) + this.age) * 31;
        SprintDecimal sprintDecimal2 = this.stature;
        int hashCode2 = (((((((((hashCode + (sprintDecimal2 != null ? sprintDecimal2.hashCode() : 0)) * 31) + this.gender) * 31) + this.language) * 31) + this.unit) * 31) + this.backlight) * 31;
        float f = this.timeZone;
        int floatToIntBits = (((((((((((((((hashCode2 + (f != 0.0f ? Float.floatToIntBits(f) : 0)) * 31) + (this.autoLap ? 1 : 0)) * 31) + (this.autoPause ? 1 : 0)) * 31) + (this.fileCover ? 1 : 0)) * 31) + this.bickNum) * 31) + this.mhr) * 31) + this.lthr) * 31) + this.ftp) * 31;
        SprintDecimal sprintDecimal3 = this.alaSpeed;
        if (sprintDecimal3 != null) {
            i = sprintDecimal3.hashCode();
        }
        return ((((((((floatToIntBits + i) * 31) + this.alaHr) * 31) + (this.keyTone ? 1 : 0)) * 31) + this.sport) * 31) + (this.isInitBit ? 1 : 0);
    }
}
